#ifndef SETTINGS_H
#define SETTINGS_H

#include "files/file.h"
#include "patterns/singleton.h"

#include <string>
#include <vector>

namespace Tvimeg
{
	class Settings : public Singleton<Settings>
	{
	private:
		typedef std::vector<Directory> DirectoryList;
		typedef std::vector<std::string> StringList;

	public:
		bool		Initialise(void);

		typedef DirectoryList::const_iterator DirectoryIterator;
		typedef StringList::const_iterator StringIterator;

		DirectoryIterator	MoviesBegin(void) const		{ return movies.begin(); }
		DirectoryIterator	MoviesEnd(void) const		{ return movies.end(); }

		DirectoryIterator	TVSeriesBegin(void) const	{ return tvSeries.begin(); }
		DirectoryIterator	TVSeriesEnd(void) const		{ return tvSeries.end(); }

		StringIterator		FileTypesBegin(void) const	{ return fileTypes.begin(); }
		StringIterator		FileTypesEnd(void) const	{ return fileTypes.end(); }

		StringIterator		MultiPartsBegin(void) const	{ return multiParts.begin(); }
		StringIterator		MultiPartsEnd(void) const	{ return multiParts.end(); }

		const File&			GetDatabaseFile(void) const	{ return databaseFile; }

	private:
		Settings(void);
		Settings(const Settings& other);
		~Settings(void);

		friend class Singleton<Settings>;
		friend class SettingsParser;

		void		AddMovieDirectory(const Directory& directory);
		void		AddTVSeriesDirectory(const Directory& directory);

		void		AddFileType(const std::string& fileType);
		void		AddMultiPart(const std::string& multiPart);

		void		SetDatabaseFile(const File& file);

		DirectoryList	movies;
		DirectoryList	tvSeries;

		StringList		fileTypes;
		StringList		multiParts;

		File			databaseFile;
	};
}

#endif // SETTINGS_H
